package ua.kpi_java_training.gluschenko.module1;

import junit.framework.TestCase;

import static ua.kpi_java_training.gluschenko.module1.division.*;

public class divisionTest extends TestCase {

    public void testIsNumber() throws Exception {
        assertEquals(true,isNumber("123"));
        assertEquals(false,isNumber("123-"));
    }

    public void testIsDivisorValid() throws Exception {
        divisorStr="-123";
        assertEquals(true,isDivisorValid());
        divisorStr="0";
        assertEquals(false,isDivisorValid());
    }

    public void testDoOneStepDivision() throws Exception {
        workPartStr="123";
        divisor=11;
        doOneStepDivision();
        assertEquals(121,product);
        assertEquals(2,rest);
        }

    public void testDoZeroStepLess() throws Exception {
        dividend=123;
        divisor=11;
        dividendStr="123";
        divisorStr="11";
        doZeroStep();
        assertEquals("12", workPartStr);
    }

    public void testDoZeroStepMore() throws Exception {
        dividend=1234;
        divisor=13;
        dividendStr="1234";
        divisorStr="13";
        doZeroStep();
        assertEquals("123", workPartStr);
    }


}
